package iq.jndi;

import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			Hashtable env = new Hashtable();
			env.put(Context.INITIAL_CONTEXT_FACTORY, 
			    "com.sun.jndi.fscontext.RefFSContextFactory");

			Context ctx = new InitialContext(env);
			// Look up an object
		    Object obj = ctx.lookup(args[0]);

		    // Print it
		    System.out.println(args[0] + " is bound to: " + obj);

		} catch (NamingException e) {
			System.err.println("Problem looking up " + args[0] + ": " + e);
		}


	}

}
